From f43717a42e79eace619caa34e40b5e2d34f6cbb2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonas=20=C3=85dahl?= Date: Wed, 24 Jul 2019 15:45:34 +0200 Subject: [PATCH] popover: Unrealize when autohide prop changes Changing the autohide property means the popover needs to be remapped. Remapping may need user interaction, so lets just unrealize the popover if the property changes, forcing the application to remap it should it be shown again. --- gtk/gtkpopover.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c index af1fee728b..b626a3fbd6 100644 --- a/gtk/gtkpopover.c +++ b/gtk/gtkpopover.c @@ -1649,6 +1649,9 @@ gtk_popover_get_position (GtkPopover *popover) * A modal popover will grab the keyboard focus on it when being * displayed. Clicking outside the popover area or pressing Esc will * dismiss the popover. + * + * Called this function on an already showing popup with a new autohide value + * different from the current one, will cause the popup to be hidden. **/ void gtk_popover_set_autohide (GtkPopover *popover, @@ -1665,6 +1668,8 @@ gtk_popover_set_autohide (GtkPopover *popover, priv->autohide = autohide; + gtk_widget_unrealize (GTK_WIDGET (popover)); + g_object_notify_by_pspec (G_OBJECT (popover), properties[PROP_AUTOHIDE]); } -- 2.30.2